
function upload(id){
	$('#'+id+'_btn').hide()
	$('#'+id+'_loading').show();
	$.ajaxFileUpload({
		url:'?action=upload&field='+id,
		fileElementId:id,
		success: function(data, status){
			$('#'+id+'_loading').hide();
			if (0==data.body.innerHTML.indexOf('/')){
				$('#'+id+'_url').val(data.body.innerHTML);
				$('#'+id+'_btn').show().addClass('uploaded');
				$('#'+id+'_done').show();
			}
			else{
				alert(data.body.innerHTML);
				$('#'+id+'_btn').show().removeClass('uploaded');;
			}
		},
		error: function(data, status, e){ alert(e); }
	});
}

$(function(){
});
